import httplib
host='www.baidu.com'
url='http://www.baidu.com/index.html'
h = httplib.HTTP()
h.set_debuglevel(1)
h.connect(host)
h.putrequest('GET', url)
h.endheaders()
status, reason, headers =h.getreply()
print headers
